var terrUl;
$(function() {
	terrUl = $("#treeUL").ligerTree({
		checkbox : true
	});
});
function saveRA() {
	var data = terrUl.getChecked();
	if(data.length == 0){
		$.ligerDialog.warn("亲，请选择功能!");
	}
	var names ="";
	for ( var i = 0; i < data.length; i++) {
		names += ";"+data[i]['data']['text'];
	}
	names = names.substring(1);
	var json = {};
	json.names = names;
	
	jQuery.ajax({
		url:'/v1/r/saveRA/'+ridValue,
		dataType:'json',
		data:json,
		type:'post',
		success:function(data){
			if(data){
				$.ligerDialog.success("授权成功!");
			}else{
				$.ligerDialog.error("网络错误,授权失败!");
			}
		},error:function(){
			$.ligerDialog.error("网络错误,授权失败!");
		}
	})
}